const Controller = require('../prototype/Controller')
const { models } = require('../model')

class ToolTag extends Controller {
  constructor () {
    super()
    this.model = models.ToolTag
  }

  updateStatus () {
    return async (ctx) => {
      const { id, status } = ctx.request.body
      const result = await this.model.updateById(id, {
        $set: { status: status }
      })
      ctx.wrapper.succ(result)
    }
  }
}

module.exports = ToolTag
